<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Bienvenido a Ranking Padel v1.0</title>
</h:head>
<h:body>
	<h:form>
		<table>
			<tr>
				<td><h:outputLabel for="id" value="Id : " /></td>
				<td><p:inputText id="id" value="#{UserBean.id}">
						<f:converter converterId="javax.faces.Integer" />
						<p:ajax event="blur" update="idMsg" />
					</p:inputText> <p:message id="idMsg" for="id" display="icon" /></td>
			</tr>
			<tr>
				<td><h:outputLabel for="name" value="Name : " /></td>
				<td><p:inputText id="name" value="#{UserBean.name}">
						<f:validateLength minimum="5" />
						<p:ajax event="blur" update="nameMsg" />
					</p:inputText> <p:message id="nameMsg" for="name" display="icon" /></td>
			</tr>
			<tr>
				<td><h:outputLabel for="surname" value="Surname : " /></td>
				<td><p:inputText id="surname" value="#{UserBean.surname}">
						<f:validateLength minimum="5" />
						<p:ajax event="blur" update="surnameMsg" />
					</p:inputText> <p:message id="surnameMsg" for="surname" display="icon" /></td>
			</tr>
			<tr>
				<td><p:commandButton id="addUser" value="Add"
						action="#{UserBean.addUser}"/></td>
				<td><p:commandButton id="reset" value="Reset"
						action="#{UserBean.reset}" ajax="false" /></td>

				<td><p:commandButton id="findUser" value="Buscar"
						actionListener="#{UserBean.findUserById(1)}" update="name" /></td>
			</tr>
		</table>
	</h:form>
</h:body>
</html>
